package com.luke.account.web;

import com.alibaba.fastjson.JSONObject;
import com.lukle.account.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by lusen on 2016/12/30.
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @RequestMapping(value="/a",produces="application/json;charset=UTF-8")
    @ResponseBody
    public Object get(){
//        JSONObject jsonObject = new JSONObject();
//        jsonObject.put("name","abc");
//        jsonObject.put("age",123);
//        return jsonObject;
//        Map<String,String> map = new HashMap();
//        map.put("name","abc");
//        map.put("age","1213");
//        return map;
        User user = new User();
        user.setAge(11);
        return user;
    }
}
